/*
 * @authors :Bin Mei
 * @date    :2017-08-10
 * @description：票交汇APP-h5 -> 投资模块
 */
import Auth from 'src/utils/requireAuth';
import format from 'src/utils/format';
import Pcolumn from './Publicity/column';

module.exports = {
	path: 'other',
	childRoutes: [
		// require('./Publicity/route'),//宣传页分类
		{
		  path: ':category',//宣传页分类
		  getComponent(location, cb) {
		  	// security = 八重保障，credit = 银行信用，license=政府牌照，intelligent= 智能科技
				require.ensure([], (require) => {
				  cb(null, require('./Publicity'));
				});
		  },
			onEnter: (nextState, replace) => {
				let columnItem = Pcolumn.filter(v=>v.linkName === nextState.params.category);
				let title = columnItem.length&&columnItem[0].name || "八重保障";
				Auth(nextState, replace,{ title})
			}
		}
	],
	indexRoute: { onEnter: (nextState, replace) => replace('/app/other/security') }
}